package com.cyl.game.demos.web.service.Impl;

import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import com.cyl.game.demos.web.mapper.HeroMapper;
import com.cyl.game.demos.web.entity.Hero;
import com.cyl.game.demos.web.service.HeroService;
import javax.annotation.Resource;

@Service()
@Transactional
public class HeroServiceImpl implements HeroService {
    @Resource
    private HeroMapper heroDesignMapper;

    @Override
    public int addHeroDesign(Hero heroDesign) {
        return heroDesignMapper.insertHeroDesign(heroDesign);
    }

    @Override
    public List<Hero> getHeroDesignsByUserId(Integer user_id) {
        return heroDesignMapper.selectHeroDesignsByUserId(user_id);
    }

    @Override
    public int updateHeroDesign(Hero heroDesign) {
        return heroDesignMapper.updateHeroDesign(heroDesign);
    }

    @Override
    public int deleteHeroDesign(Integer hero_id) {
        return heroDesignMapper.deleteHeroDesign(hero_id);
    }
}